package com.gdcp.mapper;

import com.gdcp.beans.Category;
import com.gdcp.beans.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface UserMapper {

    User queryInfoById(@Param(value = "id") Integer id);
    
    int insert(User record);

    User selectLogin(@Param("username") String username, @Param("password") String password);

    List<User> findPageBreakByCondition(Map<String, Object> param);

    int removeByPrimaryKey(@Param(value = "id") Integer id);

    int updateByPrimaryKey(User record);

    List<User> checkUsername(String username);

    List<User> checkEmail(String email);

    //int checkEmailByUserId(@Param(value = "email") String email, @Param(value = "id") Integer userId);

    int updateThumbnailByPrimaryKey(User queryUser);

    List<User> searchInformation(Map<String,Object> model);

    int updateShopId(@Param(value = "shop_id") Integer shop_id, @Param(value = "id") Integer user_id);

    User findByUserName(String username);

    List<User> findPageBreakByConditionByShopId(@Param(value = "shop_id") Integer shop_id);

    List<User> findAll(Map<String, Object> model);

    List<Category> searchInformationByShopId(Map<String, Object> model);

    List<Category> searchSizeByShopId(@Param(value = "shop_id") Integer shop_id);
}
